Remove unneeded command and add delay function