fixed isid() helper function