Fixed SQL General Error bug