fixed decrementation, but there is a problem with deletion