removed Dir.exists? for 1.87 compatibility