Fixed bug for correct alignment