replace rescue block
fix Rakefile generation