fixing isValid Helper function privacy