fix alignment code