fix overflow issue on code sample