fixed a bug that caused labels not positioned correctly