remove bug in the code to improve compatibility with future data