Wrote isModalPast method