fix delete funtionality