fixed bugs, added feature to resend last command