fixed deprecated error_messages bug