added validation
Updated JS to allow up/down votes