Added separate exception handling