fixed up handling of clicking on widgets; fixed up type accepted by animate() function