The issue is very clear, Cannot find 'frame', you haven't declared anything called frame anywhere.
If you just replace 'frame' with null, it will use a default frame for you.