Fixed same user voting twice

Also fixed cursor.commit() --> connection.commit()