Adding additional exception handling