add getevent function and updates resize function