fixed the different issues of align to work correctly