add end statement on \n