fix for undefined js bug.