Moved the fail utility function to utils