removed a few bugs and pdf generator now uses DAO