Changed the globals include statement
changed the includes and modified the userId grab to check if userid is set first