Adding code to make stop of DB a bit cleaner