fixing getId to return an integer if the ID is a number. uses ctype_digit() to check the id value