fixing ipad statechange bug