fixed a bug that causes some warnings