added rescue handler
fixed rescue handler