fixed some bugs
Merge branch 'working' into develop