Added attributes to renderForm function and fixed bug in constructor.