fix infinity issue