Added exists and fixed a bug with DEV_DIR