Bug fixes in css and event appending