fixed more overflow problems