logging added, catch exception