Fixing pop up bug