wrote tests and added id to logging