Switched back to the older logic, as this seemed not work.