added more utility error checking functions