added guards and right parameters