GetPost function corrected