changes to work with both h2 and mysql