fix missed endif