moved sqlback allocation to the stack. closes #513.