Added some new features and fixed cookie problem