fix bug in ordering calls