fix select for events sorting
fix merge conflicts