Added fix for linux (not beautiful, but working)