fixed bug in patch