change method to get time