Do realpath check at the top