fixed firstError method