fixing the code... the non-blocking nature of nodejs pissed me off