some fixes for client side detection