add sort the stack