fix crashes and commands