Improve error handling
Move error handling to separate chained promise