fix for js bug