removed last /n from action and leave functions