there was err passed into if `s instead of res - fixed