missed { } brackets in if then else after insertion of log message