make sure date picker is removed when not needed