fixed bugs in javascript access