fix date aquisition and improve extension handling