bugfix the order of afteropen execution