Fixed small but which came from forgeting to add end after and if statement