added a redirect_to :back action so that when you upvote from respective page, it will not redirect to root all the time