Fixed a bug in secure controller