readd check for ctx == nil