direction error handling
fix direct error handling