Fixed bug mixed while fixing rubocop error