Improvment on OSX compatiility