Implement Event handlers, Fix for bugs