Changed panic to log in case of exception happened