fixes for db