fixed a bug in header motion