added error returns to parser