detect s4 more correctly