(bug) Fix issue where deletion from database crashes server