I been trying to copy my FBO to file

My FBO looks like this:

Code :
    glGenFramebuffers(1, &framebuffer);
    glBindFramebuffer(GL_FRAMEBUFFER, framebuffer);
    glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, colorAttachment0, 0);
    glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, depthAttachment);

and my copy to file code looks like this:

Code :
    unsigned char* pixels3 = new unsigned char[(int)WIDTH * (int)HEIGHT * 4];
    glReadPixels(0, 0, 800, 800, GL_RGBA, GL_UNSIGNED_BYTE, pixels3);
    stbi_write_png("capture3.png", WIDTH, HEIGHT, 4, pixels3, WIDTH * 4);

But the image it write out is always black.