fix crashes when a before is not present