add try catch block to get Exception 404, 307, 504