removed globals from controller