sp error in models