fixes #940

fix rubocop bugs