rewrite retrieve id method to general version