control buttons and fixing error when clicking on blackdrop