fixed a bug, still don't know what was wrong