fixed an error with x-offset