Register Error messages and some bugs fixed