created helper method that dynamically updates time