added error handling for check if offer is valid