Added extra logic for x axis offset setting