Fixed bug with generate and getTime