fixing small js bug