Fixed a bug in Scaffold controller