fixed some bug with relative positions