fixing the deprecation notice;
removing deprecated method calls
correcting the links query to actually work