key checking in sample project

stage.switchBD to stage.setBD
Added key checking in sample project