Fixed critical bug and added delete method