fixing out of order call