Clean up error check