Add optional argument for polling frequency