Make it compatible with updated Apache Spark Code