fix local variable typo and properly call rake task