Given that (totally inadequate) problem description, I would guess that you are not debouncing the key. I think MikroC (a compiler I have never used) has a function that lets you do this but you can always look up key debouncing on Google for a number of examples (many using PIC devices and you should be able to implement the code - or at least the underlying concepts - in any language you like.
When you describe a problem you should tell us what you expect to happen and under what cirumstances, what does happen that you do not want and what doesn;t happen that you do. As mentioned above, code (especially a small but complete program that exhibits the problem) and possibly a scehmatic is always useful.
Susan