wip, fixed bug with check-function