correctly checking if laayout file exists on the server