last minute js bug fix