fix perform_sql call