Fixed broken code and delete feature