fixed docs, added checks