add overflow control