Trim output from db