fixed overflow bug