fixed bugs in models