removed threading, added max res check