upgraded gems and added guard