miss implementation in an if clause