Fixed ol_close function with simple forloop