I get the problem, but that's not the case. The solutions is exactly what I had in mind: https://github.com/juho-jaakkola/Elgg/commit/382d4be58c93e59d703bae493a68ff0356d833ea