Updated the code to compile with nightly