created method for controller