updated login staff function