fixed duplicate code in admin controller