Fixed error on creating events