fixed a lot of bug in the code, now it runs with out internet and can alose send notification to user