the code works for all frame kinds without exception