hande the exception correctly