Fixes nullpointer exception to do with proxys