Wat... is_directory()... who wrote this... lel