working on bugfix for sql-related crash