added exception handling for checking status.