fixed jslint issues where no {} in if/else