optimize user experience and fix js bug