fix a bug of applying