using enum for error modes