removed unecessary logging and unecessary setting and deleting of maxId