Fixed key handling; added jquery