add a check for resp being null