updated retrieve_statement