Is the settimeout really need?  Why are we waiting 50 milliseconds?