Improves deprecated trap