Fixing controller scope issue