Added error and timer handling