Fix catching exception