pin/unpin action calculation fix