Errors now working correctly