add code for limit checking.