Changed directory logic