Added model state checking attribute and fixed bugs with signin