Adding a if condition to avoid bug if no problem exists