Fix condition for checking double pointer