Moved main_dir_chk() to common.py