fixed some functionality with the popup