javascript try catch not catching error async