fixed a bug in sps