Realised that the desktop filter needed to be done as well so incorporated it into the code I had written for the mobile one.