added date parsing and fixed some issues