Fixed the detatched head in the post build script