fixes #2 use sortflag that is avaiable in php < 5.4