Added Directory check condition