modal close fix / if(valid) fix in extension