check if directory exists before binding