Modified TomFrame so that it works as required.