push memory allocation inside the getFrame function