quick bugfix. this needs more work, but works for now.