add mode for js