automatically retrieve manager code.  Add referer safeguard