Turns out the code works. I needed to enable non important timers to wakeup the computer by opening control powercfg.cpl,,3 -> Sleep -> Allow wake timers -> Enable instead of Important only. I'm wondering now how can I configure the timer to be considered as important