Adding some check to avoid errors