added javascript magic