Fixed issues with popup overflowing on screens with small height