modified RTC function