Added messages and fixed null error