changed db accessor
Fixed output and redirect