improve and error fix