Fix bug on deleting commands