added handling for tag ref in Java