bugfixes: some foolproof added