fixed add to and remove from functionality in database.