fixed bug in correct_alignment