added conditional label alignment