bugfix: count in if