make sure we're not calling open on a directory