fix the check of size