fixed path and added error_log in catch block