minor changes
possible memory leak fix
added datetime