I think you're missing END statements, idk though I don't like doing it on one line. (goes against coding style) and it just makes more sense to do it with proper style.