added exception handle