checked rubocop and removed useless assignment to variable