analytics added and a bug fixed