Fix bug in controller activity and entity map