Debug problem with saving to DB