fix bug where filename would get f'ed up in DB