reimplemented ubuntu 12 compatability