Removed extra spaces on is_dir check