lets try to move code to php script