Fixing bug in view