timeout added, bug fixes