Added wait_event handler. Added relese operation.