Fixed findRange in abstractDAO and shortened the login code