Fix for proxy not being assigned
code cleanup