Added error checking for acc overflow