fix sql command error and fix download resource return