Fixed the replaceScene bug