update error handling for ls