added security checks to node controller