fixed part of delete bug