prepare function prelogue, several function calls still fail