Fixed erros on gateways, made controller initialize only when and if used