Fix cached

Only abstract and concrete classes can have cached functions

fixes #544