fixed DB timeout errors

also implemented worst frame logic