fix insert bug,add input limits