fix invalid php count statement (identified by IDE - unsure if it was causing bug