prev pr + tests & fix