Started fixing bug where popup doesnt dissapear and minor fixing