fix and test for wps loop