fixed SQL type error