closing statement after statement has finished