Will be improved in the subsequent PR which handles the data cleanly. As of now, this fixes a critical bug.