replaced old fix with Giacom's idea