fixes the issue with empty div being displayed