Adds missing return in error check

Required to prevent `cb` being invoked twice