improve and correct a bug