fixed GetDate Method. Made more robust