Too much code is missing.
Why not posting the file ?