Fixed issue caused by passing an extra parameter to a prepared statement