Improve Can function for fsm