Add function for error checking