fixed bugs that had type error and that had refrence before assignment error for eventful