Edited to abide by glassfish requirements