fixed javascript code brackets