fixed a bug in alignment