add rescue functionality