fix- catching the exception