fix end to endif