Catching security exceptions