fixed last space bug