fixed the head with begin rescue