Added up and down event logic