exception handling inserted