fixed bug where too much processing would happen