Fix to latest issue. Code does not crash anymore but something does not work as intended