added functionality to find last controller used in remote class