Added dircheck Function