Move elog outside of catch block