removed unnecessary files and added try catch block within callback function