fixed bug in alignment criterion