updated getInstance method in controller