fix js bug with not exist element