added code to do rescue