fixed some minor bugs with add and delete