fixed refactor bugs so app is functional again