fixed bug with bad reference and added doormat