dealing with possible errors after lm