changed client logic to enable removing directory

Signed-off-by: Hongyi Jia <Hongyi.Jia.GR@dartmouth.edu>