a lame attempt at making it work under different osses