fixed bug: wrong deletion of code