read_commands function now clears commands and keywords to prevent duplicate additions.