Updated code for proper operation of delete folder command

GCP-9015

Post commit code review : Dan Jao