Added system exception handling