Added third an optional argument `types` to use prepared statement