Fixed crash caused by a long press gesture