Stability of a single top layer of cubes