fixed some bugs as a result of rubocop