added a little javascript functionality