fixed overflow issues