replace [0] with .startswith
optimize and fix replies/throttling