fixed index and added events