fix wrong dir check