fix bad sustition bug