added countered referer and made counter optional