fixed if else end syntx error in locals controller