I've had trouble with the syntax; I think you need
if(...){
...
} else{
}
Namely you need to have the 'else' on the same line as the end '}' of the 'if'