fixed problem with last post date and fixed problem with global vars