handling exceptions added