error checking for non-ending %