adding proxy awareness and some safety around it