fixed some missing code, also put a comment in dao