ctx now global variable