fixed jittering bug
Merged with david